#include "test_sim.h"
#include "cm_uart.h"
#include "cm_demo_uart.h"



void cm_test_sim_operation(unsigned char*cmd[],int len)
{
    if(0 == strncmp("CPIN",cmd[2],strlen("CPIN")))
    {
        //cm_demo_printf("cm_sim_get_cpin ret:%d\n", cm_sim_get_cpin());
    }else if(0 == strncmp("IMSI",cmd[2],strlen("IMSI")))
    {
        char imsi[30] = {0};
        int32_t sim_get_imsi = cm_sim_get_imsi(imsi);
        cm_demo_printf("cm_sim_get_imsi ret:%d\n",sim_get_imsi);
        OCTEST_FUNC_EXPECT_EQUAL_INT32(0,sim_get_imsi,cm_sim_get_imsi);
        cm_demo_printf("imsi:%s\n",imsi);
    }
    // else if(0 == strncmp("ICCID",cmd[2],strlen("ICCID")))
    // {
    //     char iccid[30] = {0};
    //     cm_demo_printf("cm_sim_get_iccid ret:%d\n", cm_sim_get_iccid(iccid));
    //     cm_demo_printf("iccid:%s\n",iccid);
    // }else if(0 == strncmp("PLUG",cmd[2],strlen("PLUG")))
    // {
    //     if(0 == strcmp("CONNECT",cmd[3]))
    //     {
    //         cm_sim_plug_status(1, 1);
    //     }else if(0 == strcmp("DISCONNECT",cmd[3]))
    //     {
    //         cm_sim_plug_status(1, 0);
    //     }else {
    //         cm_demo_printf("param error!\n");
    //     }

    // }else if(0 == strncmp("DETECT",cmd[2],strlen("DETECT")))
    // {
    //     if(0 == strcmp("ENABLE",cmd[3]))
    //     {
    //         cm_demo_printf("cm_sim_detect_switch ret:%d\n", cm_sim_detect_switch(1, 1));
    //     }else if(0 == strcmp("DISABLE",cmd[3]))
    //     {
    //         cm_demo_printf("cm_sim_detect_switch ret:%d\n", cm_sim_detect_switch(1, 0));
    //     }else{
    //         cm_demo_printf("param error!\n");
    //     }
    // }
    else{
        cm_demo_printf("param error!\n");
    }
}